<template>
	<view>
		<view class="header">
			<text>营业厅人数：</text>
			<text>{{total}}人</text>
		</view>
		<view class="team_info" v-for="(item,index) in myTeamList" :key="index">
			<view class="team_box">
				<u-avatar :src="item.head_img" :size="100"></u-avatar>
				<view>
					<view class="user_info">
						<view class="nick_name u-line-1" style="font-size: 25rpx;"><text style="font-size: 20rpx;">昵称：</text>{{item.name}}
						<view style="color: #fff;"><text style="font-size: 20rpx;">客户编码：</text>{{item.spread_code}}
						</view>
						<view style="color: #fff;"><text style="font-size: 20rpx;">手机号：</text>{{item.phone}}</view>
						</view>
						
						<view class="user_level">
							<image class="levelIcon" src="https://yunxingzhan.oss-cn-hangzhou.aliyuncs.com/miniprogram/images/images/level.png"></image>
							<view class="level_txt">{{item.level_name}}</view>
						</view>
						<view class="team_time">
							<view>{{item.create_time}}</view>
						</view>
					</view>
				</view>
			</view>
			
		</view>
		<u-loadmore :status="status" color="#909399" :margin-top="20"/>
		<login-model ref="loginModel"></login-model>
		<hoverMenu></hoverMenu>
	</view>
</template>

<script>
	import hoverMenu from "@/components/public/sa-hover-menu.vue";
	import loginModel from "@/components/public/loginModel.vue";
	import {myTeam} from "@/common/api.js";
	export default {
		components: {
			loginModel,
			hoverMenu
		},
		data() {
			return {
				keyword:"",
				total:0,
				myTeamList:[],
				status: 'loadmore',
				page:1
			}
		},
		onReachBottom() {
			this.page++;
			this.status="loading";
			myTeam(this,{page:this.page,limit:10,type:0,uid:this.keyword})
		},
		onLoad() {
			myTeam(this,{page:this.page,limit:10,type:0})
		},
		
		methods: {
			floatTouchClick(index){
				this.$uniApi.floatTouch(index);
			},
			search(val){ 
				this.page=1;
				this.myTeamList=[];
				myTeam(this,{page:this.page,limit:10,type:0,uid:val})
			}
		}
	}
</script>

<style>
	page{
		font-family: PingFang SC;
		/* #ifndef H5 */
		background: linear-gradient(180deg,#20cbd4,#a0edf1);
		/* #endif */
		/* #ifdef H5 */
		background: #20cbd4;
		/* #endif */
	}
	.header{
		background: linear-gradient(90deg, #a0edf1, #20cbd4) no-repeat;
		padding: 20rpx;
		border-radius: 15rpx;
		color: #13797f;
		font-size: 35rpx;
		font-weight: 650;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.team_info{
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 120rpx;
		border-radius: 50rpx;
		background: rgba(19,121,127,.2);
		/*padding: 0rpx 40rpx 10rpx 0;*/
		margin: 30rpx 10rpx;
	}
	.team_box{
		display: flex;
		align-items: center;
	}
	.user_info{
		display: flex;
		margin-left: 20rpx;
	}
	.nick_name{
		color: #FFFFFF;
		margin-right: 40rpx;
		font-size: 30rpx;
		line-height: 40rpx;
	}
	.user_level{
		height: 40rpx;
		background: linear-gradient(90deg, #fbbf48,#fff) no-repeat;;
		border-radius: 20px;
		display: flex;
		align-items: center;
		padding-right: 20rpx;
		margin-top: 40rpx;
	}
	.levelIcon{
		width: 40rpx;
		height: 40rpx;
		margin-right: 10rpx;
		position: relative;
		left: -5rpx;
	}
	.level_txt{
		text-align: center;
		font-size: 20rpx;
		color: #20CBD4;
	}
	.user_remark{
		font-size: 22rpx;
		margin-left: 20rpx;
		color: #13797f;
	}
	.team_time{
		color: #f6f6f6;
		font-size: 25rpx;
		text-align: right;
		margin-left: 20rpx;
		margin-top: 40rpx;
	}
</style>
